<template>
  <div v-show="showModel">
    <div
      style="
        display: flex;
        padding: 10px;
        padding-left: 0;
        justify-content: space-between;
      "
    >
      <div style="width: 20%">
        <img
          src="@/assets/images/flag.png"
          style="width: 140px; height: 60px"
          alt=""
        />
      </div>
      <div
        style="
          width:50%
          text-align: center;
          font-weight: bold;
          margin-right:50px
        "
      >
        <div style="text-align: center;font-size: 22px !important;">
          申楷桢防伪科技(苏州) &nbsp;有限公司
        </div>
        <div style="text-align: center; margin-top: 5px;font-size: 22px !important;">生产通知单</div>
        <div
          style="height: 1px; border-top: 1px solid #000; margin-top: 5px"
        ></div>
        <div
          style="height: 1px; border-top: 1px solid #000; margin-top: 3px"
        ></div>
      </div>
      <div
        style="
          width: 10%;
          text-align: right;
          display: felx;
          justify-content: flex-end;
        "
      >
        <div ref="code" style="width: 70px; height: 70px"></div>
      </div>
    </div>
    <div v-if="showDetail">
      <div style="display: flex; padding-bottom: 10px">
        <span style="">订单单号: {{ productFrom.saleOrderGroupNumber }}</span>
        <div style="margin-left: 10px">
          生产单号: {{ detailFrom.baseData.produceTaskBillNo }}
        </div>
        <div style="margin-left: 10px">
          协议书号: {{ detailFrom.orderBaseData.xieYiShuHao }}
        </div>
        <div style="margin-left: 10px">
          客户单号: {{ detailFrom.orderBaseData.customerBillNo }}
        </div>
        <span style="margin-left: 10px"
          >送货时间:{{ productFrom.saleOrderList[0].deliveryDate }}</span
        >
      </div>
      <div style="border: 1px solid #000; border-bottom: none">
        <div style="width: 100%; display: flex; flex-wrap: wrap; padding: 5px">
          <div style=" margin-top: 5px; width: 50%">
            产品名称: {{ productFrom.saleOrderList[0].orderProduct.productName }}
          </div>
          <div style=" margin-top: 5px; width: 50%">
            订货单位:{{ productFrom.customerName }}
          </div>
          <div style=" margin-top: 5px; width: 25%">
            产品编号:{{ productFrom.saleOrderList[0].orderProduct.productNumber }}
          </div>
          <div style=" margin-top: 5px; width: 25%">
            产品申放数量: {{ productFrom.saleOrderList[0].dataQuantity }}
          </div>
          <div style=" margin-top: 5px; width: 25%">
            订单数量:{{ productFrom.saleOrderList[0].productQuantity  *productFrom.saleOrderList[0].orderProduct.productTagNumber}}枚
          </div>
          <div style=" margin-top: 5px; width: 25%">
            理论用料:{{ detailFrom.baseData.theoreticalMaterials }}米
          </div>
          <div style=" margin-top: 5px; width: 25%">
            版本: {{ 'V'+productFrom.saleOrderList[0].orderProduct.newVersion + '.' +productFrom.saleOrderList[0].orderProduct.updateVersion  }}
          </div>
          <div style=" margin-top: 5px; width: 25%">
            数据来源: {{  getDataFrom(productFrom.saleOrderList[0].dataComeFrom)  }}
          </div>
          <div style=" margin-top: 5px; width: 25%">
            生产数量: {{ detailFrom.baseData.productionQuantity }}枚
          </div>
          <div style=" margin-top: 5px; width: 25%">
            打印用料: {{ detailFrom.baseData.printingMaterials }}米
          </div>
          <div style=" margin-top: 5px; width: 25%">
            版面: {{ productFrom.saleOrderList[0].orderProduct.productLayout }}
          </div>
          <div style=" margin-top: 5px; width: 25%">
            到料情况: {{ detailFrom.baseData.materialArrival }}
          </div>
          <div style=" margin-top: 5px; width: 25%">
            库存数量: {{ productStockQuantity }}枚
          </div>
          <div style=" margin-top: 5px; width: 25%">
            计划用料: {{ detailFrom.baseData.plannedMaterials }}米
          </div>
        </div>

        <div
          style="text-align: center; border-top: 1px solid #000; padding: 5px 0"
        >
          标签信息
        </div>
        <div style="display: flex; border-bottom: 1px solid #000">
          <div style="width: 80%">
            <table border="0" style="width: 100%">
              <thead>
                <tr>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      font-size: 11px;
                      width: 40px;
                    "
                  >
                    序号
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      
                      width: 165px;
                    "
                  >
                    标签
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      
                      width: 130px;
                    "
                  >
                    类型
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      
                      width: 90px;
                    "
                  >
                    形状
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      
                      width: 60px;
                    "
                  >
                    尺寸
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      
                      width: 40px;
                    "
                  >
                    R角
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      
                      width: 40px;
                    "
                  >
                    边空
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      text-align: left;
                      padding-left: 5px;
                      font-weight: normal;
                      font-size: 11px;
                      width: 80px;
                    "
                  >
                    印面名称
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-left: none;
                      font-weight: normal;
                      
                      width: 40px;
                    "
                  >
                    数码
                  </th>
                  <th
                    style="
                      border: 1px #000 solid;
                      border-right: none;
                      font-weight: normal;
                      
                      width: 40px;
                    "
                  >
                    条码
                  </th>
                </tr>
              </thead>
              <tbody>
                <template v-for="(item, index) in productInfo.productTagList">
                  <tr :key="index">
                    <td
                      style="
                      border: 1px #000 solid;
                      border-top: none;
                      border-left: none;
                      text-align: center;
                      position:relative
                      font-size:12px
                      height:100%
                    "
                      :style="{
                        borderBottom:
                        item.productTagPrintingLayerList.length >
                          3
                            ? ''
                            : '1px solid',
                      }"
                      :rowspan="item.productTagPrintingLayerList.length"
                    >
                      <div
                        style="
                          position: absolute;
                          top: 50%;
                          left: 50%;
                          transform: translate(-50%, -50%);
                          
                        "
                      >
                        {{ index + 1 }}
                      </div>
                    </td>
                    <td
                      style="
                        border: 1px #000 solid;
                        border-top: none;
                        text-align: center;
                        
                      "
                      :style="{
                        borderBottom:
                        item.productTagPrintingLayerList.length >
                          3
                            ? ''
                            : '1px solid',
                      }"
                      :rowspan="item.productTagPrintingLayerList.length"
                    >
                      <div style="font-size: 12px">
                        {{ item.productTagName }}
                      </div>
                    </td>
                    <td
                      style="
                        border: 1px #000 solid;
                        border-left: none;
                        border-top: none;
                        text-align: center;
                        
                      "
                      :style="{
                        borderBottom:
                        item.productTagPrintingLayerList.length >
                          3
                            ? ''
                            : '1px solid',
                      }"
                      :rowspan="item.productTagPrintingLayerList.length"
                    >
                      <div style="font-size: 12px">
                        {{ getTagType(item.tagType)  }}
                      </div>
                    </td>
                    <td
                      style="
                        border: 1px #000 solid;
                        border-left: none;
                        border-top: none;
                        text-align: center;
                        
                      "
                      :style="{
                        borderBottom:
                        item.productTagPrintingLayerList.length >
                          3
                            ? ''
                            : '1px solid',
                      }"
                      :rowspan="item.productTagPrintingLayerList.length"
                    >
                      <div style="font-size: 12px">
                        {{ getTagShapeName(item.tagShape)  }}
                      </div>
                    </td>
                    <td
                      style="
                      border: 1px #000 solid;
                      border-left: none;
                      border-top: none;
                      text-align: center;
                      position:relative
                      font-size:12px
                    "
                      :style="{
                        borderBottom:
                        item.productTagPrintingLayerList.length >
                          3
                            ? ''
                            : '1px solid',
                      }"
                      :rowspan="item.productTagPrintingLayerList.length"
                    >
                      <div
                        style="
                          position: absolute;
                          top: 50%;
                          left: 50%;
                          transform: translate(-50%, -50%);
                          
                        "
                      >
                        {{ item.tagWidth }}*{{ item.tagHeight }}
                      </div>
                    </td>
                    <td
                      style="
                      border: 1px #000 solid;
                      border-left: none;
                      border-top: none;
                      text-align: center;
                      position:relative
                      font-size:12px
                    "
                      :style="{
                        borderBottom:
                        item.productTagPrintingLayerList.length >
                          3
                            ? ''
                            : '1px solid',
                      }"
                      :rowspan="item.productTagPrintingLayerList.length"
                    >
                      <div
                        style="
                          position: absolute;
                          top: 50%;
                          left: 50%;
                          transform: translate(-50%, -50%);
                          
                        "
                      >
                        {{ item.tagBorderRadius }}
                      </div>
                    </td>
                    <td
                      style="
                      border: 1px #000 solid;
                      border-left: none;
                      border-top: none;
                      text-align: center;
                      position:relative
                      font-size:12px
                    "
                      :style="{
                        borderBottom:
                        item.productTagPrintingLayerList.length >
                          3
                            ? ''
                            : '1px solid',
                      }"
                      :rowspan="item.productTagPrintingLayerList.length"
                    >
                      <div
                        style="
                          position: absolute;
                          top: 50%;
                          left: 50%;
                          transform: translate(-50%, -50%);
                          
                        "
                      >
                        {{ item.tagBorder }}
                      </div>
                    </td>
                    <td
                      style="
                        border: 1px #000 solid;
                        border-left: none;
                        border-top: none;
                        border-right: none;
                        text-align: left;
                        padding-left: 5px;
                        
                      "
                      rowspan="1"
                    >
                      {{ item.productTagPrintingLayerList[0].printingLayerName }}
                    </td>
                    <td
                      style="
                        border: 1px #000 solid;
                        border-left: none;
                        border-top: none;
                        border-right: none;
                        text-align: center;
                        
                      "
                      rowspan="1"
                    >
                      {{ item.productTagPrintingLayerList[0].technoPlaces }}
                    </td>
                    <td
                      style="
                        border: 1px #000 solid;
                        border-left: none;
                        border-top: none;
                        border-right: none;
                        text-align: center;
                        
                      "
                      rowspan="1"
                    >
                      {{ item.productTagPrintingLayerList[0].barCodePlaces }}
                    </td>
                  </tr>
                  <template>
                    <tr
                      v-for="(children, index) in item.productTagPrintingLayerList"
                      v-if="index != 0"
                    >
                      <td
                        rowspan="1"
                        style="
                          border: 1px #000 solid;
                          border-left: none;
                          border-top: none;
                          border-right: none;
                          text-align: left;
                          padding-left: 5px;
                          
                        "
                        :style="{
                          borderBottom:
                          productInfo.productTagList[0].productTagPrintingLayerList
                              .length > 3 &&
                            index == item.productTagPrintingLayerList.length - 1
                              ? ''
                              : '1px solid',
                        }"
                      >
                        {{ children.printingLayerName }}
                      </td>
                      <td
                        rowspan="1"
                        style="
                          border: 1px #000 solid;
                          border-left: none;
                          border-top: none;
                          border-right: none;
                          text-align: center;
                          
                        "
                        :style="{
                          borderBottom:
                          productInfo.productTagList[0].productTagPrintingLayerList
                          .length > 3 &&
                            index == item.productTagPrintingLayerList.length - 1
                              ? ''
                              : '1px solid',
                        }"
                      >
                        {{ children.technoPlaces }}
                      </td>
                      <td
                        rowspan="1"
                        style="
                          border: 1px #000 solid;
                          border-left: none;
                          border-top: none;
                          text-align: center;
                          border-right: none;
                          
                        "
                        :style="{
                          borderBottom:
                          productInfo.productTagList[0].productTagPrintingLayerList
                              .length > 3 &&
                            index == item.productTagPrintingLayerList.length - 1
                              ? ''
                              : '1px solid',
                        }"
                      >
                        {{ children.barCodePlaces }}
                      </td>
                    </tr>
                  </template>
                </template>
              </tbody>
            </table>
          </div>
          <div
            style="
              flex: 1;
              border: 1px solid #000;
              font-size: 11px;
              border-right: none;
              border-bottom: none;
              padding-bottom: 5px;
            "
            v-if="productInfo"
          >
            <p style="margin-top: 5px; padding-left: 3px">
              标签种类：{{ productInfo.baseData.productTypeName }}
            </p>
            <p style="margin-top: 5px; padding-left: 3px">
              被贴物：{{  getPostedContent(productInfo.productTagList) }}
            </p>
            <p style="margin-top: 5px; padding-left: 3px">
              材料：{{
                getMaterialName(productInfo.productTagList)
              }}
            </p>
            <p style="margin-top: 5px; padding-left: 3px">
              表面要求：{{
                getSurfaceRequires(productInfo.productTagList)
              }}
            </p>
            <p style="margin-top: 5px; padding-left: 3px">
              底膜颜色：{{
                getColor(productInfo.productTagList)
              }}
            </p>
          </div>
        </div>
        <div
          style="
            text-align: center;
            padding: 5px 0;
            border-bottom: 1px solid #000;
          "
        >
          生产信息
        </div>
        <div
          style="
            font-size: 12px !important;
            overflow: hidden;
            border-bottom: 1px solid #000;
            box-sizing: border-box;
          "
        >
          <div
            style="
              width: 50%;
              float: left;
              border-right: 1px solid #000;
              box-sizing: border-box;
            "
          >
            <div style="border-bottom: 1px solid #000; display: flex">
              <div
                style="
                  box-sizing: border-box;
                  padding: 2px;
                  width: 10%;
                  text-align: center;
                "
              >
                序号
              </div>
              <div style="display: flex; padding: 2px; flex: 1">
                <div style="width: 33%; text-align: left">颜色名称</div>
                <div style="width: 33%">参考</div>
                <div style="width: 33%">备注</div>
              </div>
            </div>

            <div
              v-for="(cItem, index) in productInfo.productPrintingColorList"
              :key="index"
              style="display: flex"
              :style="{
                borderBottom: index + 1 < productInfo.productPrintingColorList.length ? '1px solid' : '',
              }"
            >
              <div
                style="
                  box-sizing: border-box;
                  padding: 2px;
                  width: 10%;
                  text-align: center;
                "
              >
                {{ index + 1 }}
              </div>
              <div style="display: flex; padding: 2px; flex: 1">
                <div style="width: 33%; text-align: left">
                  {{ cItem.colorName }}
                </div>
                <div style="width: 33%">{{ getColorReference(cItem.colorReference)  }}</div>
                <div style="width: 33%">{{ cItem.colorRemark }}</div>
              </div>
            </div>
          </div>
          <div
            style="
              width: 50%;
              float: left;
              border-left: 1px solid #000;
              margin-left: -1px;
              box-sizing: border-box;
            "
          >
            <div style="">
              <div
                style="
                  display: flex;
                  padding: 2px;
                  flex: 1;
                  flex-wrap: wrap;
                  padding: 5px;
                "
              >
                <div style="width: 50%; margin-bottom: 5px">
                  版辊尺寸: {{ productdd.makeup_RollSize + "mm" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  拼版: {{ productdd.makeup_Combine || "--" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  数码版面: {{ productdd.makeup_DigitalEdition + "mm" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  模数: {{ productdd.makeup_Modules || "--" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  跳距: {{ productdd.makeup_SkipDistance + "mm" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  平张: {{ productdd.makeup_PzDz || "--" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  间距: {{ productdd.makeup_SpaceBetween + "mm" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  丝网涂层:
                  {{
                    getScrapingCoatingColorName(productInfo.productTagList)
                  }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  留边尺寸: {{ detailFrom.baseData.marginSize + "mm" }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  丝网文字:
                  {{
                    getScrapingWordColorName(productInfo.productTagList)
                  }}
                </div>
                <div style="width: 50%; margin-bottom: 5px">
                  色数: {{ productdd.makeup_Colors || "--" }}
                </div>
              </div>
            </div>
          </div>
        </div>

        <div
          style="
            font-size: 12px !important;
            overflow: hidden;
            box-sizing: border-box;
            display: flex;
          "
        >
          <div style="width: 100%; height: 100%; box-sizing: border-box">
            <div
              style="
                border-bottom: 1px solid #000;
                display: flex;
                text-align: center;
              "
            >
              <div style="display: flex; flex: 1">
                <div
                  style="width: 5%; border-right: 1px solid #000; padding: 2px"
                >
                  序号
                </div>
                <div style="width: 10%; padding: 2px; text-align: left">
                  工艺名称
                </div>
                <div style="width: 10%; padding: 2px">生产设备</div>
                <div
                  style="width: 10%; padding: 2px; border-right: 1px solid #000"
                >
                  工时(分)
                </div>
                <div style="width: 10%; padding: 2px">物料种类</div>
                <div style="width: 20%; padding: 2px; text-align: left">
                  物料名称
                </div>
                <div style="width: 10%; padding: 2px">规格型号</div>
                <div style="width: 20%; padding: 2px">备注</div>
              </div>
            </div>
            <div style="text-align: center">
              <div
                v-for="(Citem, index) in eqList"
                :key="Citem.stockGoodsCode"
                style="display: flex; flex: 1"
                class="tt"
                :style="{
                  borderBottom: index + 1 < eqList.length ? '1px solid' : '',
                }"
              >
                <div
                  style="width: 5%; border-right: 1px solid #000; padding: 2px"
                >
                  {{ index + 1 }}
                </div>
                <div style="width: 10%; padding: 2px; text-align: left">
                  {{ Citem.produceCraftName }}
                </div>
                <div style="width: 10%; padding: 2px">
                  {{ Citem.produceEquipmentName }}
                </div>
                <div
                  style="width: 10%; padding: 2px; border-right: 1px solid #000"
                >
                  {{ Citem.produceCraftPlanUseTime }}
                </div>
                <div style="width: 10%; padding: 2px">
                  {{ Citem.categoryName }}
                </div>
                <div style="width: 20%; padding: 2px; text-align: left">
                  {{ Citem.goodsName }}
                </div>
                <div style="width: 10%; padding: 2px">
                  {{ Citem.stockGoodsName }}
                </div>
                <div style="width: 20%; padding: 2px">
                  {{ Citem.produceMaterialRemark }}
                </div>
              </div>
            </div>
          </div>
        </div>
        <div
          style="
            text-align: center;
            padding: 5px 0;
            border-top: 1px solid #000;
            border-bottom: 1px solid #000;
          "
        >
          成品信息/备注
        </div>
        <div
          style="
            padding-right: 0;
            border-bottom: 1px solid #000;
            font-size: 12px !important;
            overflow: hidden;
            box-sizing: border-box;
            display: flex;
          "
        >
          <div
            style="
              width: 20%;
              padding: 5px;
              height: 100%;
              border-right: 1px solid #000;
              line-height: 1.5em;
            "
          >
            <div style="font-size: 12px">
              成品样式: {{ getProductStyleName(productFrom.saleOrderList[0].orderProduct.productStyle) }}
            </div>
            <div style="font-size: 12px" v-if="productFrom.saleOrderList[0].orderProduct.productStyle == 2">
              出标方向: {{ getOutDirectionName(productFrom.saleOrderList[0].orderProduct.outDirection) }}
            </div>
            <div style="font-size: 12px" v-if="productFrom.saleOrderList[0].orderProduct.productStyle == 2">
              卷向: {{ getScrollDirectionName(productFrom.saleOrderList[0].orderProduct.scrollDirection) }}
            </div>
            <div style="font-size: 12px">
              贴标方式: {{ getTagAffixWayName(productFrom.saleOrderList[0].orderProduct.tagAffixWay) }}
            </div>
            <div style="font-size: 12px" v-if="productFrom.saleOrderList[0].orderProduct.productStyle == 2">
              纸管卷径: {{ productFrom.saleOrderList[0].orderProduct.mandrelSize }}mm
            </div>
            <div style="font-size: 12px" v-if="productFrom.saleOrderList[0].orderProduct.productStyle == 2">
              外直径不超过: {{ productFrom.saleOrderList[0].orderProduct.notOverDiameter }}mm
            </div>
            <div style="font-size: 12px" v-if="productFrom.saleOrderList[0].orderProduct.productStyle == 2">
              每卷等于: {{ productFrom.saleOrderList[0].orderProduct.pageEqualTags
              }}{{ productFrom.saleOrderList[0].orderProduct.productUnit }}
            </div>
          </div>

          <div
            style="
              width: 80%;
              height: 100%;
              padding-right: 0;
              box-sizing: border-box;
              border-left: 1px solid #000;
              margin-left: -1px;
            "
          >
            <div style="min-height: 50px; padding: 5px">
              <span style="font-weight: bold">业务要求</span>
              <div>
                {{ productFrom.saleOrderList[0].remark}}
              </div>
            </div>
            <div
              style="
                border-top: 1px solid #000;
                box-sizing: border-box;
                padding: 5px;
              "
            >
              <span style="font-weight: bold">生产要求</span>
              <div>
                {{ productdd.produceRemark }}
              </div>
              <div style="display: flex; margin-top: 20px">
                <div style="flex: 1">
                  <span>刀版信息:{{ productdd.knifeInformation }}</span>
                </div>
                <div style="flex: 1">
                  <span>印版信息:{{ productdd.plateInformation }}</span>
                </div>
              </div>
            </div>
            <div
              style="min-height: 50px; padding: 5px; border-top: 1px solid #000"
            >
              <span style="font-weight: bold">包装信息</span>
            </div>
          </div>
        </div>
      </div>
      <div
        style="
          display: flex;
          padding: 10px;
          padding-left: 0;
          justify-content: space-between;
        "
      >
        <div style="display: flex; font-size: 12px">
          <span style="font-size: 12px"
            >开单时间: {{ produceTaskData.openProduceBillTime }}</span
          >
          <div style="margin-left: 10px; font-size: 12px">
            开单人员: {{ openProduceBillPersonName }}
          </div>
          <span style="padding-left: 10px; font-size: 12px"
            >审核意见: 同意</span
          >
        </div>
        <div style="display: flex; justify-content: flex-end">
          <span style="font-size: 12px"
            >业务员: {{ productFrom.creatorName }}</span
          >
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import JsBarcode from "jsbarcode";
import QRCode from "qrcodejs2";
export default {
  name: "PrintOrder",
  props: {
    productFrom: {
      type: Object,
      default: () => ({
        baseData: {
          xieYiShuHao: "",
        },
      }),
    },
    detailFrom: {
      type: Object,
      default: () => ({}),
    },
    productdd: {
      type: Object,
      default: () => ({}),
    },

    productInfo:{
      type: Object,
      default: () => ({}),
    }
  },
  data() {
    return {
      showDetail: false,
      border: "",
      showModel: false,
      colorList: [],
      eqList: [],
      openProduceBillPersonName: "",
      productStockQuantity: 0,
      produceTaskData:''
    };
  },
  watch: {
    productFrom: {
      deep: true,
      handler(val) {},
    },
    productdd: {
      deep: true,
      handler(val) {
        if (val.produceTaskBillNo) {
          this.$api.product
            .GetProduceWorkBillData({
              produceTaskBillNo: val.produceTaskBillNo,
            })
            .then((res) => {
              this.colorList = res.printColorList;
              this.openProduceBillPersonName =
                res.produceTaskData.openProduceBillPersonName;
              this.productStockQuantity = res.orderData.productStockQuantity;
              this.eqList = res.craftMaterialList;
              this.produceTaskData = res.produceTaskData
            })
            .catch(() => {});
          console.log(val);
        }
      },
    },
  },
  created() {},
  methods: {
    GetProduceWorkBillData(code) {},

    getDataFrom(str){
      let name
      if(str == 0){
        name= '无'
      }else if(str == 1){
        name = '客户'
      }else{
        name = '自编'
      }
      return name
    },

    //获取产品样式名称
    getProductStyleName(str){
      let name
      if(str == 1){
        name= '平张'
      }else if(str == 2){
        name = '卷式'
      }else{
        name = '折页'
      }
      return name
    },

    //获取出标方向
    getOutDirectionName(str){
      let name
      if(str == 1){
        name= '上'
      }else if(str == 2){
        name = '下'
      }else if(str ==  3){
        name = '左'
      }else{
        name = '右'
      }
      return name
    },
    //卷向
    getScrollDirectionName(str){
      let name
      if(str == 1){
        name= '页面朝内'
      }else if(str == 2){
        name = '页面朝外'
      }
      return name
    },

    getTagAffixWayName(str){
      let name
      if(str == 1){
        name= '自动贴'
      }else if(str == 2){
        name = '手贴'
      }
      return name
    },

    //获取被贴物
    getPostedContent(arr){
      let arr1 = []
      arr.forEach(element => {
        arr1.push(element.postedContent)
      });
      return Array.from(new Set(arr1)).join('/')
    },

    //获取材料
    getMaterialName(arr){
      let arr1 = []
      arr.forEach(element => {
        element.productTagPrintingLayerList.forEach((item)=>{
          arr1.push(item.printingMaterialName)
        })
      });
      arr1 = Array.from(new Set(arr1)).join('/')
      return arr1 
    },

    //获取刮开图层颜色名称
    getScrapingCoatingColorName(arr){
      let arr1 = []
      arr.forEach(element => {
        arr1.push(element.scrapingCoatingColorName)
      });
      arr1 = Array.from(new Set(arr1)).join('/')
      return arr1 
    },

    //获取刮开文字颜色名称
    getScrapingWordColorName(arr){
      let arr1 = []
      arr.forEach(element => {
        arr1.push(element.scrapingWordColorName)
      });
      arr1 = Array.from(new Set(arr1)).join('/')
      return arr1 
    },

    //获取表面要求
    getSurfaceRequires(arr){
      let arr1 = []
      arr.forEach(element => {
        arr1.push(element.surfaceRequires)
      });
      arr1 = Array.from(new Set(arr1)).join('/')
      return arr1 
    },

    //获取低膜颜色
    getColor(arr){
      let arr1 = []
      arr.forEach(element => {
        element.productTagPrintingLayerList.forEach((item)=>{
          arr1.push(item.baseFilmColorName)
        })
      });
      arr1 = Array.from(new Set(arr1)).join('/')
      return arr1 
    },

    //获取标签类型
    getTagType(str){
      let name
      if(str == 1){
        name = '刮开'
      }else if(str == 2){
        name = '揭开'
      }else if(str == 3){
        name = '刮开+揭开'
      }else{
        name = '印刷'
      }
      return name
    },

    //获取标签形状
    getTagShapeName(str){
      let name
      if(str == 1){
        name = '长方形'
      }else if(str == 2){
        name = '正方形'
      }else if(str == 3){
        name = '圆形'
      }else if(str == 4){
        name = '椭圆形'
      }else{
        name = '异形'
      }
      return name
    },

    //获取颜色参考名称
    getColorReference(str){
      let name
      if(str == 1){
        name = '彩稿'
      }else if(str == 2){
        name = '样表'
      }else if(str == 3){
        name = '封样'
      }
      return name
    },

    setCode(val) {
      console.log(this.$refs.code);
      this.$nextTick(() => {
        this.$refs.code.innerHTML = "";
        new QRCode(this.$refs.code, {
          text: val.produceTaskBillNo, //二维码内容
          width: 70,
          height: 70,
          render: "table",
          colorDark: "#000000", //二维码颜色
          colorLight: "#ffffff", //二维码背景色
          correctLevel: QRCode.CorrectLevel.H, //容错率，L/M/H
        });
      });
    },
  },
};
</script>

<style scoped>
*{
  color: #000 !important;
  font-size: 12px;
}
.a {
  align-content: flex-end;
  position: absolute;
}
</style>

